<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of sealplayer
 *
 * @author Samuel
 */
class playerdetailinfo_controller extends Controller {
    private $areaIDList;	//大区ID列表
    private $areaID2Addr;	//大区游戏服地址列表
    private $wholeServerHost;    //全局地址
    private $m;

    function _init()
    {
        $config = get_config();
        $this->wholeServerHost = $config['host_url'];
		
        $server_list=get_server_list();

        //var_dump($server_list);
        foreach($server_list as $k=>$row) {
            $this->areaIDList[$row['SvrOutAddr']] = $row['SvrID'];
            $this->areaID2Addr[$row['SvrID']] = $row['SvrOutAddr'];
        }		
    }

    function index()
    {
        if(is_submit())
        {
            //ini_set('mongo.long_as_object', 1);
            $rowdata = $_POST['row'];
            $role_id = $rowdata['role_id'];
            
            $isnum = is_numeric($rowdata['role_id']);
            if ( false == $isnum ){ // 输入角色名，需要查找玩家ID和账号
                $post_data['Name']=$role_id;
                $post_data['SessionID']="ewewqw";
                $post_data['SessionKey']="wqqew";

                //$re = vpost($this->wholeServerHost.'gm_get_playerid_by_name',3,json_encode($post_data));
				$config = get_config();
				$re = vpost($config['host_url_acc'].'gm_get_playerid_by_name',3,json_encode($post_data));
                if ( $re ) {
                    $res=json_decode($re,true);
                    $account = $res['AccountID'];
                    $playerid = $res['PlayerID'];
                    $areanum = $res['SvrID'];
                } else {
                    $result = translate ( 'C_TIPS_ERROR_TEXT' );
                    error ( $result );
                }
            }else{ //直接通过玩家输入的玩家ID得到账号和区号
                $len = strlen($role_id);
                $area_num_str = substr($role_id, $len-6, 3);
                $acc_str = substr($role_id, 0, $len-6);
                $account = (int)$acc_str;
                //query server mapping
                $areanum = (int)$area_num_str;
                $playerid = $role_id;
            }

            $pd['SessionID']="ewewqw";
            $pd['SessionKey']="wqqew";
            $pd["SvrID"] = (int)$areanum;
            $pd['PlayerID']=$playerid;
			
			// modify by 20191031
			if(!in_array($areanum,$this->areaIDList)){  
				error("角色不在任何大区");
			}
			$wholeServerHost="https://".$this->areaID2Addr[$areanum]."/";
			$strResult = vpost($wholeServerHost.'query_player_info',3,json_encode($pd));
            //$strResult = vpost($this->wholeServerHost.'query_player_info',3,json_encode($pd));
			
            $result=json_decode($strResult,true);

            //操作失败或者连接失败
            if($result['RetCode'] == 0){
                $this->view->assign('curhero1name', $result['CurHeros'][0]['HeroName']);
                $this->view->assign('curhero1fightvalue', $result['CurHeros'][0]['FightValue']);
                $this->view->assign('curhero2name', $result['CurHeros'][1]['HeroName']);
                $this->view->assign('curhero2fightvalue', $result['CurHeros'][1]['FightValue']);
                $this->view->assign('curhero3name', $result['CurHeros'][2]['HeroName']);
                $this->view->assign('curhero3fightvalue', $result['CurHeros'][2]['FightValue']);
                $this->view->assign('curhero4name', $result['CurHeros'][3]['HeroName']);
                $this->view->assign('curhero4fightvalue', $result['CurHeros'][3]['FightValue']);
                $this->view->assign('curhero5name', $result['CurHeros'][4]['HeroName']);
                $this->view->assign('curhero5fightvalue', $result['CurHeros'][4]['FightValue']);
                $this->view->assign('curhero6name', $result['CurHeros'][5]['HeroName']);
                $this->view->assign('curhero6fightvalue', $result['CurHeros'][5]['FightValue']);

                $this->view->assign('backhero1name', $result['BackHeros'][0]['HeroName']);
                $this->view->assign('backhero2name', $result['BackHeros'][1]['HeroName']);
                $this->view->assign('backhero3name', $result['BackHeros'][2]['HeroName']);
                $this->view->assign('backhero4name', $result['BackHeros'][3]['HeroName']);
                $this->view->assign('backhero5name', $result['BackHeros'][4]['HeroName']);
                $this->view->assign('backhero6name', $result['BackHeros'][5]['HeroName']);

                $this->view->assign('curhero1equipname1', $result['Equips'][0]['Name']);
                $this->view->assign('curhero1equipname2', $result['Equips'][1]['Name']);
                $this->view->assign('curhero1equipname3', $result['Equips'][2]['Name']);
                $this->view->assign('curhero1equipname4', $result['Equips'][3]['Name']);
                $this->view->assign('curhero2equipname1', $result['Equips'][4]['Name']);
                $this->view->assign('curhero2equipname2', $result['Equips'][5]['Name']);
                $this->view->assign('curhero2equipname3', $result['Equips'][6]['Name']);
                $this->view->assign('curhero2equipname4', $result['Equips'][7]['Name']);
                $this->view->assign('curhero3equipname1', $result['Equips'][8]['Name']);
                $this->view->assign('curhero3equipname2', $result['Equips'][9]['Name']);
                $this->view->assign('curhero3equipname3', $result['Equips'][10]['Name']);
                $this->view->assign('curhero3equipname4', $result['Equips'][11]['Name']);
                $this->view->assign('curhero4equipname1', $result['Equips'][12]['Name']);
                $this->view->assign('curhero4equipname2', $result['Equips'][13]['Name']);
                $this->view->assign('curhero4equipname3', $result['Equips'][14]['Name']);
                $this->view->assign('curhero4equipname4', $result['Equips'][15]['Name']);
                $this->view->assign('curhero5equipname1', $result['Equips'][16]['Name']);
                $this->view->assign('curhero5equipname2', $result['Equips'][17]['Name']);
                $this->view->assign('curhero5equipname3', $result['Equips'][18]['Name']);
                $this->view->assign('curhero5equipname4', $result['Equips'][19]['Name']);
                $this->view->assign('curhero6equipname1', $result['Equips'][20]['Name']);
                $this->view->assign('curhero6equipname2', $result['Equips'][21]['Name']);
                $this->view->assign('curhero6equipname3', $result['Equips'][22]['Name']);
                $this->view->assign('curhero6equipname4', $result['Equips'][23]['Name']);

                $this->view->assign('curhero1gemname1', $result['Gems'][0]['Name']);
                $this->view->assign('curhero1gemname2', $result['Gems'][1]['Name']);
                $this->view->assign('curhero2equipname1', $result['Gems'][2]['Name']);
                $this->view->assign('curhero2equipname2', $result['Gems'][3]['Name']);
                $this->view->assign('curhero3equipname1', $result['Gems'][4]['Name']);
                $this->view->assign('curhero3equipname2', $result['Gems'][5]['Name']);
                $this->view->assign('curhero4equipname1', $result['Gems'][6]['Name']);
                $this->view->assign('curhero4equipname2', $result['Gems'][7]['Name']);
                $this->view->assign('curhero5equipname1', $result['Gems'][8]['Name']);
                $this->view->assign('curhero5equipname2', $result['Gems'][9]['Name']);
                $this->view->assign('curhero6equipname1', $result['Gems'][10]['Name']);
                $this->view->assign('curhero6equipname2', $result['Gems'][11]['Name']);
            }


            $this->view->assign('playerid', $playerid);
            //echo "账号: " . $account;
            $this->view->assign('account', $account);

            //echo "区号".$areanum;
            $selectSql = "SELECT * FROM server_mapping WHERE dbtype='1' AND areanum={$areanum} ";
            $this->db->query($selectSql);
            $this->server_info=$this->db->get_array('default');

            // db数据库
            $this->m = new MongoClient("mongodb://{$this->server_info['dbip']}");
            //$this->m = new MongoClient("mongodb://{$this->server_info['username']}:{$this->server_info['userpwd']}@{$this->server_info['dbip']}");

            $filter=array('_id'=>(float)$playerid);

            // PlayerRole
            $PlayerRoleColl=$this->m->{$this->server_info['dbname']}->PlayerRole;
            $PlayerRoleDoc=$PlayerRoleColl->find($filter);
            foreach ($PlayerRoleDoc as $key=>$value){
                $this->view->assign('viplevel', $value['viplevel']);
                $this->view->assign('vipexp', $value['moneys'][10]);
                $this->view->assign('diamond',$value['moneys'][0]);
                $this->view->assign('goldcoin',$value['moneys'][1]);
                $this->view->assign('famecoin',$value['moneys'][2]);
                $this->view->assign('honorcoin',$value['moneys'][3]);
                $this->view->assign('glyphcoin',$value['moneys'][4]);
                $this->view->assign('metecoin',$value['moneys'][5]);
                $this->view->assign('hooncoin',$value['moneys'][6]);
                $this->view->assign('guidcoin',$value['moneys'][7]);
                $this->view->assign('soulcoin',$value['moneys'][8]);
            }

            // PlayerHero
            $PlayerHeroColl=$this->m->{$this->server_info['dbname']}->PlayerHero;
            $PlayerHeroDoc=$PlayerHeroColl->find($filter);
            $total = count($PlayerHeroDoc);

            $post_data['SessionID']="ewewqw";
            $post_data['SessionKey']="wqqew";

            foreach ($PlayerHeroDoc as $key=>$value){
                // 查询英雄信息
                $this->view->assign('curhero1id', $value['curheros'][0]['id']);
                $this->view->assign('curhero1quality', $value['curheros'][0]['quality']);
                $this->view->assign('curhero1level', $value['curheros'][0]['level']);
                $this->view->assign('curhero1exp', $value['curheros'][0]['curexp']);

                $this->view->assign('curhero1hp', $value['curheros'][0]['propertyvalues'][0]);
                $this->view->assign('curhero1patk', $value['curheros'][0]['propertyvalues'][1]);
                $this->view->assign('curhero1pdef', $value['curheros'][0]['propertyvalues'][2]);
                $this->view->assign('curhero1matk', $value['curheros'][0]['propertyvalues'][3]);
                $this->view->assign('curhero1mdef', $value['curheros'][0]['propertyvalues'][4]);
                $this->view->assign('curhero1damagedel', $value['curheros'][0]['propertyvalues'][5]);
                $this->view->assign('curhero1damageadd', $value['curheros'][0]['propertyvalues'][6]);
                $this->view->assign('curhero1miss', $value['curheros'][0]['propertyvalues'][7]);
                $this->view->assign('curhero1hiton', $value['curheros'][0]['propertyvalues'][8]);
                $this->view->assign('curhero1crit', $value['curheros'][0]['propertyvalues'][9]);
                $this->view->assign('curhero1defcrit', $value['curheros'][0]['propertyvalues'][10]);
                $this->view->assign('curhero1critadd', $value['curheros'][0]['propertyvalues'][11]);
                $this->view->assign('curhero1critdel', $value['curheros'][0]['propertyvalues'][12]);

                $this->view->assign('curhero1equipid1', $value['curequips'][0]['id']);
                $this->view->assign('curhero1equipstrenglevel1', $value['curequips'][0]['strenglevel']);
                $this->view->assign('curhero1refinelevel1', $value['curequips'][0]['refinelevel']);
                $this->view->assign('curhero1refineexp1', $value['curequips'][0]['refineexp']);
                $this->view->assign('curhero1star1', $value['curequips'][0]['star']);
                $this->view->assign('curhero1starexp1', $value['curequips'][0]['starexp']);
                $this->view->assign('curhero1starluck1', $value['curequips'][0]['starluck']);

                $this->view->assign('curhero1equipid2', $value['curequips'][1]['id']);
                $this->view->assign('curhero1equipstrenglevel2', $value['curequips'][1]['strenglevel']);
                $this->view->assign('curhero1refinelevel2', $value['curequips'][1]['refinelevel']);
                $this->view->assign('curhero1refineexp2', $value['curequips'][1]['refineexp']);
                $this->view->assign('curhero1star2', $value['curequips'][1]['star']);
                $this->view->assign('curhero1starexp2', $value['curequips'][1]['starexp']);
                $this->view->assign('curhero1starluck2', $value['curequips'][1]['starluck']);

                $this->view->assign('curhero1equipid3', $value['curequips'][2]['id']);
                $this->view->assign('curhero1equipstrenglevel3', $value['curequips'][2]['strenglevel']);
                $this->view->assign('curhero1refinelevel3', $value['curequips'][2]['refinelevel']);
                $this->view->assign('curhero1refineexp3', $value['curequips'][2]['refineexp']);
                $this->view->assign('curhero1star3', $value['curequips'][2]['star']);
                $this->view->assign('curhero1starexp3', $value['curequips'][2]['starexp']);
                $this->view->assign('curhero1starluck3', $value['curequips'][2]['starluck']);

                $this->view->assign('curhero1equipid4', $value['curequips'][3]['id']);
                $this->view->assign('curhero1equipstrenglevel4', $value['curequips'][3]['strenglevel']);
                $this->view->assign('curhero1refinelevel4', $value['curequips'][3]['refinelevel']);
                $this->view->assign('curhero1refineexp4', $value['curequips'][3]['refineexp']);
                $this->view->assign('curhero1star4', $value['curequips'][3]['star']);
                $this->view->assign('curhero1starexp4', $value['curequips'][3]['starexp']);
                $this->view->assign('curhero1starluck4', $value['curequips'][3]['starluck']);

                $this->view->assign('curhero1gemid1', $value['curgems'][0]['id']);
                $this->view->assign('curhero1gemstrenglevel1', $value['curgems'][0]['strenglevel']);
                $this->view->assign('curhero1gemrefineexp1', $value['curgems'][0]['strengexp']);
                $this->view->assign('curhero1gemrefinelevel1', $value['curgems'][0]['refinelevel']);

                $this->view->assign('curhero1gemid2', $value['curgems'][1]['id']);
                $this->view->assign('curhero1gemstrenglevel2', $value['curgems'][1]['strenglevel']);
                $this->view->assign('curhero1gemrefineexp2', $value['curgems'][1]['strengexp']);
                $this->view->assign('curhero1gemrefinelevel2', $value['curgems'][1]['refinelevel']);


                $this->view->assign('curhero2id', $value['curheros'][1]['id']);
                $this->view->assign('curhero2quality', $value['curheros'][1]['quality']);
                $this->view->assign('curhero2level', $value['curheros'][1]['level']);
                $this->view->assign('curhero2exp', $value['curheros'][1]['curexp']);

                $this->view->assign('curhero2hp', $value['curheros'][1]['propertyvalues'][0]);
                $this->view->assign('curhero2patk', $value['curheros'][1]['propertyvalues'][1]);
                $this->view->assign('curhero2pdef', $value['curheros'][1]['propertyvalues'][2]);
                $this->view->assign('curhero2matk', $value['curheros'][1]['propertyvalues'][3]);
                $this->view->assign('curhero2mdef', $value['curheros'][1]['propertyvalues'][4]);
                $this->view->assign('curhero2damagedel', $value['curheros'][1]['propertyvalues'][5]);
                $this->view->assign('curhero2damageadd', $value['curheros'][1]['propertyvalues'][6]);
                $this->view->assign('curhero2miss', $value['curheros'][1]['propertyvalues'][7]);
                $this->view->assign('curhero2hiton', $value['curheros'][1]['propertyvalues'][8]);
                $this->view->assign('curhero2crit', $value['curheros'][1]['propertyvalues'][9]);
                $this->view->assign('curhero2defcrit', $value['curheros'][1]['propertyvalues'][10]);
                $this->view->assign('curhero2critadd', $value['curheros'][1]['propertyvalues'][11]);
                $this->view->assign('curhero2critdel', $value['curheros'][1]['propertyvalues'][12]);

                $this->view->assign('curhero2equipid1', $value['curequips'][4]['id']);
                $this->view->assign('curhero2equipstrenglevel1', $value['curequips'][4]['strenglevel']);
                $this->view->assign('curhero2refinelevel1', $value['curequips'][4]['refinelevel']);
                $this->view->assign('curhero2refineexp1', $value['curequips'][4]['refineexp']);
                $this->view->assign('curhero2star1', $value['curequips'][4]['star']);
                $this->view->assign('curhero2starexp1', $value['curequips'][4]['starexp']);
                $this->view->assign('curhero2starluck1', $value['curequips'][4]['starluck']);

                $this->view->assign('curhero2equipid2', $value['curequips'][5]['id']);
                $this->view->assign('curhero2equipstrenglevel2', $value['curequips'][5]['strenglevel']);
                $this->view->assign('curhero2refinelevel2', $value['curequips'][5]['refinelevel']);
                $this->view->assign('curhero2refineexp2', $value['curequips'][5]['refineexp']);
                $this->view->assign('curhero2star2', $value['curequips'][5]['star']);
                $this->view->assign('curhero2starexp2', $value['curequips'][5]['starexp']);
                $this->view->assign('curhero2starluck2', $value['curequips'][5]['starluck']);

                $this->view->assign('curhero2equipid3', $value['curequips'][6]['id']);
                $this->view->assign('curhero2equipstrenglevel3', $value['curequips'][6]['strenglevel']);
                $this->view->assign('curhero2refinelevel3', $value['curequips'][6]['refinelevel']);
                $this->view->assign('curhero2refineexp3', $value['curequips'][6]['refineexp']);
                $this->view->assign('curhero2star3', $value['curequips'][6]['star']);
                $this->view->assign('curhero2starexp3', $value['curequips'][6]['starexp']);
                $this->view->assign('curhero2starluck3', $value['curequips'][6]['starluck']);

                $this->view->assign('curhero2equipid4', $value['curequips'][7]['id']);
                $this->view->assign('curhero2equipstrenglevel4', $value['curequips'][7]['strenglevel']);
                $this->view->assign('curhero2refinelevel4', $value['curequips'][7]['refinelevel']);
                $this->view->assign('curhero2refineexp4', $value['curequips'][7]['refineexp']);
                $this->view->assign('curhero2star4', $value['curequips'][7]['star']);
                $this->view->assign('curhero2starexp4', $value['curequips'][7]['starexp']);
                $this->view->assign('curhero2starluck4', $value['curequips'][7]['starluck']);

                $this->view->assign('curhero2gemid1', $value['curgems'][2]['id']);
                $this->view->assign('curhero2gemstrenglevel1', $value['curgems'][2]['strenglevel']);
                $this->view->assign('curhero2gemrefineexp1', $value['curgems'][2]['strengexp']);
                $this->view->assign('curhero2gemrefinelevel1', $value['curgems'][2]['refinelevel']);

                $this->view->assign('curhero2gemid2', $value['curgems'][3]['id']);
                $this->view->assign('curhero2gemstrenglevel2', $value['curgems'][3]['strenglevel']);
                $this->view->assign('curhero2gemrefineexp2', $value['curgems'][3]['strengexp']);
                $this->view->assign('curhero2gemrefinelevel2', $value['curgems'][3]['refinelevel']);


                $this->view->assign('curhero3id', $value['curheros'][2]['id']);
                $this->view->assign('curhero3quality', $value['curheros'][2]['quality']);
                $this->view->assign('curhero3level', $value['curheros'][2]['level']);
                $this->view->assign('curhero3exp', $value['curheros'][2]['curexp']);

                $this->view->assign('curhero3hp', $value['curheros'][2]['propertyvalues'][0]);
                $this->view->assign('curhero3patk', $value['curheros'][2]['propertyvalues'][1]);
                $this->view->assign('curhero3pdef', $value['curheros'][2]['propertyvalues'][2]);
                $this->view->assign('curhero3matk', $value['curheros'][2]['propertyvalues'][3]);
                $this->view->assign('curhero3mdef', $value['curheros'][2]['propertyvalues'][4]);
                $this->view->assign('curhero3damagedel', $value['curheros'][2]['propertyvalues'][5]);
                $this->view->assign('curhero3damageadd', $value['curheros'][2]['propertyvalues'][6]);
                $this->view->assign('curhero3miss', $value['curheros'][2]['propertyvalues'][7]);
                $this->view->assign('curhero3hiton', $value['curheros'][2]['propertyvalues'][8]);
                $this->view->assign('curhero3crit', $value['curheros'][2]['propertyvalues'][9]);
                $this->view->assign('curhero3defcrit', $value['curheros'][2]['propertyvalues'][10]);
                $this->view->assign('curhero3critadd', $value['curheros'][2]['propertyvalues'][11]);
                $this->view->assign('curhero3critdel', $value['curheros'][2]['propertyvalues'][12]);

                $this->view->assign('curhero3equipid1', $value['curequips'][8]['id']);
                $this->view->assign('curhero3equipstrenglevel1', $value['curequips'][8]['strenglevel']);
                $this->view->assign('curhero3refinelevel1', $value['curequips'][8]['refinelevel']);
                $this->view->assign('curhero3refineexp1', $value['curequips'][8]['refineexp']);
                $this->view->assign('curhero3star1', $value['curequips'][8]['star']);
                $this->view->assign('curhero3starexp1', $value['curequips'][8]['starexp']);
                $this->view->assign('curhero3starluck1', $value['curequips'][8]['starluck']);

                $this->view->assign('curhero3equipid2', $value['curequips'][9]['id']);
                $this->view->assign('curhero3equipstrenglevel2', $value['curequips'][9]['strenglevel']);
                $this->view->assign('curhero3refinelevel2', $value['curequips'][9]['refinelevel']);
                $this->view->assign('curhero3refineexp2', $value['curequips'][9]['refineexp']);
                $this->view->assign('curhero3star2', $value['curequips'][9]['star']);
                $this->view->assign('curhero3starexp2', $value['curequips'][9]['starexp']);
                $this->view->assign('curhero3starluck2', $value['curequips'][9]['starluck']);

                $this->view->assign('curhero3equipid3', $value['curequips'][10]['id']);
                $this->view->assign('curhero3equipstrenglevel3', $value['curequips'][10]['strenglevel']);
                $this->view->assign('curhero3refinelevel3', $value['curequips'][10]['refinelevel']);
                $this->view->assign('curhero3refineexp3', $value['curequips'][10]['refineexp']);
                $this->view->assign('curhero3star3', $value['curequips'][10]['star']);
                $this->view->assign('curhero3starexp3', $value['curequips'][10]['starexp']);
                $this->view->assign('curhero3starluck3', $value['curequips'][10]['starluck']);

                $this->view->assign('curhero3equipid4', $value['curequips'][11]['id']);
                $this->view->assign('curhero3equipstrenglevel4', $value['curequips'][11]['strenglevel']);
                $this->view->assign('curhero3refinelevel4', $value['curequips'][11]['refinelevel']);
                $this->view->assign('curhero3refineexp4', $value['curequips'][11]['refineexp']);
                $this->view->assign('curhero3star4', $value['curequips'][11]['star']);
                $this->view->assign('curhero3starexp4', $value['curequips'][11]['starexp']);
                $this->view->assign('curhero3starluck4', $value['curequips'][11]['starluck']);

                $this->view->assign('curhero3gemid1', $value['curgems'][4]['id']);
                $this->view->assign('curhero3gemstrenglevel1', $value['curgems'][4]['strenglevel']);
                $this->view->assign('curhero3gemrefineexp1', $value['curgems'][4]['strengexp']);
                $this->view->assign('curhero3gemrefinelevel1', $value['curgems'][4]['refinelevel']);

                $this->view->assign('curhero3gemid2', $value['curgems'][5]['id']);
                $this->view->assign('curhero3gemstrenglevel2', $value['curgems'][5]['strenglevel']);
                $this->view->assign('curhero3gemrefineexp2', $value['curgems'][5]['strengexp']);
                $this->view->assign('curhero3gemrefinelevel2', $value['curgems'][5]['refinelevel']);




                $this->view->assign('curhero4id', $value['curheros'][3]['id']);
                $this->view->assign('curhero4quality', $value['curheros'][3]['quality']);
                $this->view->assign('curhero4level', $value['curheros'][3]['level']);
                $this->view->assign('curhero4exp', $value['curheros'][3]['curexp']);

                $this->view->assign('curhero4hp', $value['curheros'][3]['propertyvalues'][0]);
                $this->view->assign('curhero4patk', $value['curheros'][3]['propertyvalues'][1]);
                $this->view->assign('curhero4pdef', $value['curheros'][3]['propertyvalues'][2]);
                $this->view->assign('curhero4matk', $value['curheros'][3]['propertyvalues'][3]);
                $this->view->assign('curhero4mdef', $value['curheros'][3]['propertyvalues'][4]);
                $this->view->assign('curhero4damagedel', $value['curheros'][3]['propertyvalues'][5]);
                $this->view->assign('curhero4damageadd', $value['curheros'][3]['propertyvalues'][6]);
                $this->view->assign('curhero4miss', $value['curheros'][3]['propertyvalues'][7]);
                $this->view->assign('curhero4hiton', $value['curheros'][3]['propertyvalues'][8]);
                $this->view->assign('curhero4crit', $value['curheros'][3]['propertyvalues'][9]);
                $this->view->assign('curhero4defcrit', $value['curheros'][3]['propertyvalues'][10]);
                $this->view->assign('curhero4critadd', $value['curheros'][3]['propertyvalues'][11]);
                $this->view->assign('curhero4critdel', $value['curheros'][3]['propertyvalues'][12]);

                $this->view->assign('curhero4equipid1', $value['curequips'][12]['id']);
                $this->view->assign('curhero4equipstrenglevel1', $value['curequips'][12]['strenglevel']);
                $this->view->assign('curhero4refinelevel1', $value['curequips'][12]['refinelevel']);
                $this->view->assign('curhero4refineexp1', $value['curequips'][12]['refineexp']);
                $this->view->assign('curhero4star1', $value['curequips'][12]['star']);
                $this->view->assign('curhero4starexp1', $value['curequips'][12]['starexp']);
                $this->view->assign('curhero4starluck1', $value['curequips'][12]['starluck']);

                $this->view->assign('curhero4equipid2', $value['curequips'][13]['id']);
                $this->view->assign('curhero4equipstrenglevel2', $value['curequips'][13]['strenglevel']);
                $this->view->assign('curhero4refinelevel2', $value['curequips'][13]['refinelevel']);
                $this->view->assign('curhero4refineexp2', $value['curequips'][13]['refineexp']);
                $this->view->assign('curhero4star2', $value['curequips'][13]['star']);
                $this->view->assign('curhero4starexp2', $value['curequips'][13]['starexp']);
                $this->view->assign('curhero4starluck2', $value['curequips'][13]['starluck']);

                $this->view->assign('curhero4equipid3', $value['curequips'][14]['id']);
                $this->view->assign('curhero4equipstrenglevel3', $value['curequips'][14]['strenglevel']);
                $this->view->assign('curhero4refinelevel3', $value['curequips'][14]['refinelevel']);
                $this->view->assign('curhero4refineexp3', $value['curequips'][14]['refineexp']);
                $this->view->assign('curhero4star3', $value['curequips'][14]['star']);
                $this->view->assign('curhero4starexp3', $value['curequips'][14]['starexp']);
                $this->view->assign('curhero4starluck3', $value['curequips'][14]['starluck']);

                $this->view->assign('curhero4equipid4', $value['curequips'][15]['id']);
                $this->view->assign('curhero4equipstrenglevel4', $value['curequips'][15]['strenglevel']);
                $this->view->assign('curhero4refinelevel4', $value['curequips'][15]['refinelevel']);
                $this->view->assign('curhero4refineexp4', $value['curequips'][15]['refineexp']);
                $this->view->assign('curhero4star4', $value['curequips'][15]['star']);
                $this->view->assign('curhero4starexp4', $value['curequips'][15]['starexp']);
                $this->view->assign('curhero4starluck4', $value['curequips'][15]['starluck']);

                $this->view->assign('curhero4gemid1', $value['curgems'][6]['id']);
                $this->view->assign('curhero4gemstrenglevel1', $value['curgems'][6]['strenglevel']);
                $this->view->assign('curhero4gemrefineexp1', $value['curgems'][6]['strengexp']);
                $this->view->assign('curhero4gemrefinelevel1', $value['curgems'][6]['refinelevel']);

                $this->view->assign('curhero4gemid2', $value['curgems'][7]['id']);
                $this->view->assign('curhero4gemstrenglevel2', $value['curgems'][7]['strenglevel']);
                $this->view->assign('curhero4gemrefineexp2', $value['curgems'][7]['strengexp']);
                $this->view->assign('curhero4gemrefinelevel2', $value['curgems'][7]['refinelevel']);


                $this->view->assign('curhero5id', $value['curheros'][4]['id']);
                $this->view->assign('curhero5quality', $value['curheros'][4]['quality']);
                $this->view->assign('curhero5level', $value['curheros'][4]['level']);
                $this->view->assign('curhero5exp', $value['curheros'][4]['curexp']);

                $this->view->assign('curhero5hp', $value['curheros'][4]['propertyvalues'][0]);
                $this->view->assign('curhero5patk', $value['curheros'][4]['propertyvalues'][1]);
                $this->view->assign('curhero5pdef', $value['curheros'][4]['propertyvalues'][2]);
                $this->view->assign('curhero5matk', $value['curheros'][4]['propertyvalues'][3]);
                $this->view->assign('curhero5mdef', $value['curheros'][4]['propertyvalues'][4]);
                $this->view->assign('curhero5damagedel', $value['curheros'][4]['propertyvalues'][5]);
                $this->view->assign('curhero5damageadd', $value['curheros'][4]['propertyvalues'][6]);
                $this->view->assign('curhero5miss', $value['curheros'][4]['propertyvalues'][7]);
                $this->view->assign('curhero5hiton', $value['curheros'][4]['propertyvalues'][8]);
                $this->view->assign('curhero5crit', $value['curheros'][4]['propertyvalues'][9]);
                $this->view->assign('curhero5defcrit', $value['curheros'][4]['propertyvalues'][10]);
                $this->view->assign('curhero5critadd', $value['curheros'][4]['propertyvalues'][11]);
                $this->view->assign('curhero5critdel', $value['curheros'][4]['propertyvalues'][12]);

                $this->view->assign('curhero5equipid1', $value['curequips'][16]['id']);
                $this->view->assign('curhero5equipstrenglevel1', $value['curequips'][16]['strenglevel']);
                $this->view->assign('curhero5refinelevel1', $value['curequips'][16]['refinelevel']);
                $this->view->assign('curhero5refineexp1', $value['curequips'][16]['refineexp']);
                $this->view->assign('curhero5star1', $value['curequips'][16]['star']);
                $this->view->assign('curhero5starexp1', $value['curequips'][16]['starexp']);
                $this->view->assign('curhero5starluck1', $value['curequips'][16]['starluck']);

                $this->view->assign('curhero5equipid2', $value['curequips'][17]['id']);
                $this->view->assign('curhero5equipstrenglevel2', $value['curequips'][17]['strenglevel']);
                $this->view->assign('curhero5refinelevel2', $value['curequips'][17]['refinelevel']);
                $this->view->assign('curhero5refineexp2', $value['curequips'][17]['refineexp']);
                $this->view->assign('curhero5star2', $value['curequips'][17]['star']);
                $this->view->assign('curhero5starexp2', $value['curequips'][17]['starexp']);
                $this->view->assign('curhero5starluck2', $value['curequips'][17]['starluck']);

                $this->view->assign('curhero5equipid3', $value['curequips'][18]['id']);
                $this->view->assign('curhero5equipstrenglevel3', $value['curequips'][18]['strenglevel']);
                $this->view->assign('curhero5refinelevel3', $value['curequips'][18]['refinelevel']);
                $this->view->assign('curhero5refineexp3', $value['curequips'][18]['refineexp']);
                $this->view->assign('curhero5star3', $value['curequips'][18]['star']);
                $this->view->assign('curhero5starexp3', $value['curequips'][18]['starexp']);
                $this->view->assign('curhero5starluck3', $value['curequips'][18]['starluck']);

                $this->view->assign('curhero5equipid4', $value['curequips'][19]['id']);
                $this->view->assign('curhero5equipstrenglevel4', $value['curequips'][19]['strenglevel']);
                $this->view->assign('curhero5refinelevel4', $value['curequips'][19]['refinelevel']);
                $this->view->assign('curhero5refineexp4', $value['curequips'][19]['refineexp']);
                $this->view->assign('curhero5star4', $value['curequips'][19]['star']);
                $this->view->assign('curhero5starexp4', $value['curequips'][19]['starexp']);
                $this->view->assign('curhero5starluck4', $value['curequips'][19]['starluck']);

                $this->view->assign('curhero5gemid1', $value['curgems'][8]['id']);
                $this->view->assign('curhero5gemstrenglevel1', $value['curgems'][8]['strenglevel']);
                $this->view->assign('curhero5gemrefineexp1', $value['curgems'][8]['strengexp']);
                $this->view->assign('curhero5gemrefinelevel1', $value['curgems'][8]['refinelevel']);

                $this->view->assign('curhero5gemid2', $value['curgems'][9]['id']);
                $this->view->assign('curhero5gemstrenglevel2', $value['curgems'][9]['strenglevel']);
                $this->view->assign('curhero5gemrefineexp2', $value['curgems'][9]['strengexp']);
                $this->view->assign('curhero5gemrefinelevel2', $value['curgems'][9]['refinelevel']);



                $this->view->assign('curhero6id', $value['curheros'][5]['id']);
                $this->view->assign('curhero6quality', $value['curheros'][5]['quality']);
                $this->view->assign('curhero6level', $value['curheros'][5]['level']);
                $this->view->assign('curhero6exp', $value['curheros'][5]['curexp']);

                $this->view->assign('curhero6hp', $value['curheros'][5]['propertyvalues'][0]);
                $this->view->assign('curhero6patk', $value['curheros'][5]['propertyvalues'][1]);
                $this->view->assign('curhero6pdef', $value['curheros'][5]['propertyvalues'][2]);
                $this->view->assign('curhero6matk', $value['curheros'][5]['propertyvalues'][3]);
                $this->view->assign('curhero6mdef', $value['curheros'][5]['propertyvalues'][4]);
                $this->view->assign('curhero6damagedel', $value['curheros'][5]['propertyvalues'][5]);
                $this->view->assign('curhero6damageadd', $value['curheros'][5]['propertyvalues'][6]);
                $this->view->assign('curhero6miss', $value['curheros'][5]['propertyvalues'][7]);
                $this->view->assign('curhero6hiton', $value['curheros'][5]['propertyvalues'][8]);
                $this->view->assign('curhero6crit', $value['curheros'][5]['propertyvalues'][9]);
                $this->view->assign('curhero6defcrit', $value['curheros'][5]['propertyvalues'][10]);
                $this->view->assign('curhero6critadd', $value['curheros'][5]['propertyvalues'][11]);
                $this->view->assign('curhero6critdel', $value['curheros'][5]['propertyvalues'][12]);

                $this->view->assign('curhero6equipid1', $value['curequips'][20]['id']);
                $this->view->assign('curhero6equipstrenglevel1', $value['curequips'][20]['strenglevel']);
                $this->view->assign('curhero6refinelevel1', $value['curequips'][20]['refinelevel']);
                $this->view->assign('curhero6refineexp1', $value['curequips'][20]['refineexp']);
                $this->view->assign('curhero6star1', $value['curequips'][20]['star']);
                $this->view->assign('curhero6starexp1', $value['curequips'][20]['starexp']);
                $this->view->assign('curhero6starluck1', $value['curequips'][20]['starluck']);

                $this->view->assign('curhero6equipid2', $value['curequips'][21]['id']);
                $this->view->assign('curhero6equipstrenglevel2', $value['curequips'][21]['strenglevel']);
                $this->view->assign('curhero6refinelevel2', $value['curequips'][21]['refinelevel']);
                $this->view->assign('curhero6refineexp2', $value['curequips'][21]['refineexp']);
                $this->view->assign('curhero6star2', $value['curequips'][21]['star']);
                $this->view->assign('curhero6starexp2', $value['curequips'][21]['starexp']);
                $this->view->assign('curhero6starluck2', $value['curequips'][21]['starluck']);

                $this->view->assign('curhero6equipid3', $value['curequips'][22]['id']);
                $this->view->assign('curhero6equipstrenglevel3', $value['curequips'][22]['strenglevel']);
                $this->view->assign('curhero6refinelevel3', $value['curequips'][22]['refinelevel']);
                $this->view->assign('curhero6refineexp3', $value['curequips'][22]['refineexp']);
                $this->view->assign('curhero6star3', $value['curequips'][22]['star']);
                $this->view->assign('curhero6starexp3', $value['curequips'][22]['starexp']);
                $this->view->assign('curhero6starluck3', $value['curequips'][22]['starluck']);

                $this->view->assign('curhero6equipid4', $value['curequips'][23]['id']);
                $this->view->assign('curhero6equipstrenglevel4', $value['curequips'][23]['strenglevel']);
                $this->view->assign('curhero6refinelevel4', $value['curequips'][23]['refinelevel']);
                $this->view->assign('curhero6refineexp4', $value['curequips'][23]['refineexp']);
                $this->view->assign('curhero6star4', $value['curequips'][23]['star']);
                $this->view->assign('curhero6starexp4', $value['curequips'][23]['starexp']);
                $this->view->assign('curhero6starluck4', $value['curequips'][23]['starluck']);

                $this->view->assign('curhero6gemid1', $value['curgems'][10]['id']);
                $this->view->assign('curhero6gemstrenglevel1', $value['curgems'][10]['strenglevel']);
                $this->view->assign('curhero6gemrefineexp1', $value['curgems'][10]['strengexp']);
                $this->view->assign('curhero6gemrefinelevel1', $value['curgems'][10]['refinelevel']);

                $this->view->assign('curhero6gemid2', $value['curgems'][11]['id']);
                $this->view->assign('curhero6gemstrenglevel2', $value['curgems'][11]['strenglevel']);
                $this->view->assign('curhero6gemrefineexp2', $value['curgems'][11]['strengexp']);
                $this->view->assign('curhero6gemrefinelevel2', $value['curgems'][11]['refinelevel']);

                $this->view->assign('BACKhero1id', $value['backheros'][0]['id']);
                $this->view->assign('BACKhero1quality', $value['backheros'][0]['quality']);
                $this->view->assign('BACKhero1level', $value['backheros'][0]['level']);
                $this->view->assign('BACKhero1exp', $value['backheros'][0]['curexp']);

                $this->view->assign('BACKhero2id', $value['backheros'][1]['id']);
                $this->view->assign('BACKhero2quality', $value['backheros'][1]['quality']);
                $this->view->assign('BACKhero2level', $value['backheros'][1]['level']);
                $this->view->assign('BACKhero2exp', $value['backheros'][1]['curexp']);

                $this->view->assign('BACKhero3id', $value['backheros'][2]['id']);
                $this->view->assign('BACKhero3quality', $value['backheros'][2]['quality']);
                $this->view->assign('BACKhero3level', $value['backheros'][2]['level']);
                $this->view->assign('BACKhero3exp', $value['backheros'][2]['curexp']);

                $this->view->assign('BACKhero4id', $value['backheros'][3]['id']);
                $this->view->assign('BACKhero4quality', $value['backheros'][3]['quality']);
                $this->view->assign('BACKhero4level', $value['backheros'][3]['level']);
                $this->view->assign('BACKhero4exp', $value['backheros'][3]['curexp']);

                $this->view->assign('BACKhero5id', $value['backheros'][4]['id']);
                $this->view->assign('BACKhero5quality', $value['backheros'][4]['quality']);
                $this->view->assign('BACKhero5level', $value['backheros'][4]['level']);
                $this->view->assign('BACKhero5exp', $value['backheros'][4]['curexp']);

                $this->view->assign('BACKhero6id', $value['backheros'][5]['id']);
                $this->view->assign('BACKhero6quality', $value['backheros'][5]['quality']);
                $this->view->assign('BACKhero6level', $value['backheros'][5]['level']);
                $this->view->assign('BACKhero6exp', $value['backheros'][5]['curexp']);



                //$value['curheros'][0]['breaklevel'];
                //$value['curheros'][1]['breaklevel'];
                //$value['curheros'][2]['breaklevel'];
                //$value['curheros'][3]['breaklevel'];
                //$value['curheros'][4]['breaklevel'];
                //$value['curheros'][5]['breaklevel'];

            }



            $this->view->display("player_info_detail/playerdetail");
        }else{
            $this->view->display("player_info_detail/queryplayer");
        }

        //var_dump($this->areaList)
    }

}

?>
